package JAVACORE_TRAINING.OOPS_CONCEPTS.OOPs_EXCERCISES.LEVER01.EX01;

public class Models {
	
	public double Calculator(NumberObject objObject){
		//1. Khai báo tường minh biến nhận KQ
		double result = 0;
		switch (objObject.getShOpt()) {
			case 0: //+
				result = objObject.getNumA() + objObject.getNumB(); break;
			case 1: //-
				result = objObject.getNumA() - objObject.getNumB(); break;
			case 2: //*
				result = objObject.getNumA() * objObject.getNumB(); break;
			case 3: //chia
				result = objObject.getNumA() / objObject.getNumB(); break;			
		}
		return result;
	}
}
